Skip to content

chore: throw error when importing core twice #7784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: build/v2
Choose a base branch
from

Conversation

wmertens
Copy link
Member

@wmertens wmertens commented Aug 6, 2025

v2 version of #7109 with vendorRoots removal

also features reworking the router build so it doesn't import core

  • dev server now can hot reload routes

TODO: remove vite-dev-server from qwik

@wmertens wmertens requested review from a team as code owners August 6, 2025 09:04
Copy link

changeset-bot bot commented Aug 6, 2025

🦋 Changeset detected

Latest commit: 4fc27e6

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wmertens wmertens force-pushed the v2-throw-duplicate branch from 694fb2e to 80fa09c Compare August 6, 2025 09:09
Copy link
Contributor

github-actions bot commented Aug 6, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 5453cd4

@wmertens
Copy link
Member Author

wmertens commented Aug 6, 2025

the reason playwright errored and now the cli tests that both run vite in ssr server mode which loads vite config with uses qwik-router vite plugin, which imports qwik core, and then the preview server runs in-process with its own qwik core copy. So it's actually a bug in our bundling!

@wmertens wmertens force-pushed the v2-throw-duplicate branch from 80fa09c to 372c9da Compare August 15, 2025 12:46
- remove separate dev-server which duplicated route processing logic, instead use node adapter
- watch routes for changes and reload when needed
-  make route imports always dynamic (optionally static). This limits the amount of code to load when not all paths are visited, and reduces startup time.
- remove .testing condition on double import, the reason was the dev-server importing core separately from the test code

Still missing:
- transformindexhtml handling
- entry.ts support
- serviceworker support
@wmertens wmertens force-pushed the v2-throw-duplicate branch from cef66cb to 24463c5 Compare August 15, 2025 14:08
@wmertens wmertens force-pushed the v2-throw-duplicate branch from 24463c5 to dc4560b Compare August 15, 2025 14:45
@wmertens wmertens marked this pull request as draft August 15, 2025 16:13
@wmertens wmertens force-pushed the v2-throw-duplicate branch from 4743ea1 to 4fc27e6 Compare August 15, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants